package org.springframework.howelly.validators;

import org.springframework.binding.message.MessageBuilder;
import org.springframework.binding.message.MessageContext;
import org.springframework.howelly.model.OrdenDePago;

public class OrdenDePagoValidator {

    public static boolean validateNewOrdenDePago(OrdenDePago ordenDePago, MessageContext context) {
	if (ordenDePago.getProveedor() == "") {
	    context.addMessage(new MessageBuilder().error().source("proveedor").defaultText(
		    "Por favor, seleccione un proveedora").build());
	    return false;
	}
	return true;
    }
}
